# coding=utf-8
'''
域名扫描敏感文件
'''

import requests,re
from mv import Smmulv
class DomeSm(object):
	def __init__(self):
		self._mv = Smmulv()
	def Sm(self,line):
		'''
		网站分解
		'''
		li =['.rar','.zip','.gz','.bak','.7z']
		ni =[]
		no =[]
		for i in li:
			w = re.search(r"www",line,re.S)
			if w == None:
				w1 = line.split('/')
				a = line+'/'+w1[2]+i#test.com
				ni.append(a)
				w22 = str(w1[2])
				w2 = w22.split('.')
				b = line+'/'+w2[0]+i#test
				ni.append(b)
			else:
				d1 = line.split('.')
				a = line+'/'+d1[1]+i#test
				no.append(a)
				d2 = line.split('/')
				b = line+'/'+d2[2]+i#www.test.com
				no.append(b)
				d22 = str(d2[2])
				d3 = d22.split('.')
				d33 = d3[1]+'.'+d3[2]#test.com
				c = line+'/'+d33+i
				no.append(c)
		for b1 in no:
			#print b1
			self._mv.domemv(b1)
		for a1 in ni:
			#print a1
			self._mv.domemv(a1)

		'''
		wz = re.findall(r'\..*?\/(.*)',line)#目录递归扫描
		print wz
		for i in wz:
			print i.split('/')
		'''
# cms =DomeSm()
# cms.Sm(line='http://www.test.com')
